DROP TABLE jms_dwd.dwd_netwrok_metric_dictionary_dt;
CREATE EXTERNAL TABLE jms_dwd.dwd_netwrok_metric_dictionary_dt(
    `network_code` string COMMENT '网点Code', 
    `network_name` string COMMENT '网点名称', 
    `network_type` int COMMENT '网点类型', 
    `province_id` string COMMENT '省份ID', 
    `province_name` string COMMENT '省份名称', 
    `city_id` string COMMENT '城市ID', 
    `city_name` string COMMENT '城市名称', 
    `area_id` string COMMENT '区县ID', 
    `area_name` string COMMENT '区县名称', 
    `agent_code` string COMMENT '代理区Code', 
    `agent_name` string COMMENT '代理区名称', 
    `virt_code` string COMMENT '虚拟代理区Code', 
    `virt_name` string COMMENT '虚拟代理区名称', 
    `regional_id` string COMMENT '大区ID', 
    `regional_name` string COMMENT '大区名称', 
    `metric_name` string COMMENT '指标名', 
    `metric_value` decimal(12,2) COMMENT '指标值', 
    `update_time` timestamp COMMENT '更新时间'
)
COMMENT '指标字典表'
PARTITIONED BY (
    `dt` string COMMENT '时间分区(yyyy-MM-dd)',
    `metric_code` string COMMENT '指标code'
)
ROW FORMAT SERDE
  'org.apache.hadoop.hive.ql.io.parquet.serde.ParquetHiveSerDe'
STORED AS INPUTFORMAT 
  'org.apache.hadoop.hive.ql.io.parquet.MapredParquetInputFormat' 
OUTPUTFORMAT 
  'org.apache.hadoop.hive.ql.io.parquet.MapredParquetOutputFormat'
LOCATION
  'hdfs://yl-bg-hdp/dw/hive/jms_dwd.db/external/dwd_netwrok_metric_dictionary_dt'